<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <title>会计科目</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
   	<script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
 
    <script type="text/javascript">

    $(document).ready(function(){
    	$("#itemCategory").select2();
     	searchListForm();
    });
    
		// 检索按钮实装方法
		function searchListForm() {
			var sItemCode = $("#itemCode").val();	
			var sItemName = $("#itemName").val();	
			var sItemCategory = $("#itemCategory").val();	
			$("#activity_pane").showLoading();
			$.post("${ctx}/finance/subject/searchList?itemCode="+sItemCode + "&itemName="+sItemName + "&itemCategory="+sItemCategory , "", function(result) {
				var listHtml = result["dict"];
				var pageHtml = result["page"];
				$("#listHtml").html(listHtml);
				$("#paging").html(pageHtml);
				$("#activity_pane").hideLoading();
			}, 'json');
		} 
		//重置
		function clean() {
			$("input").val("");
			$("select").val("");
			searchListForm();
		}
		$(document).keydown(function(event){
	    	if(event.keyCode == 13){
	    		searchListForm();
	    	}
	    });
		
    </script>
</head>
<body>
	<div class="listArea" id="activity_pane" >
		<form id="searchForm" name="searchForm" method="post">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
			<div class="listBg" >
				<div class="searchArea clearfix">
					<div class="searchLeft clearfix" style="width: calc(100% - 300px);">
						<div class="searchInp clearfix">
						<!-- 科目代码 -->
						    <p><spring:message code="account_code" /></p>
                            <input class="w-customer"  id="itemCode"  name="itemCode"  >
						</div>
						<!-- 科目名称 -->
						<div class="searchInp clearfix">
							<p><spring:message code="course_title" /></p>
                            <input class="w-customer"  id="itemName"  name="itemName"  >
						</div>
					   	<div class="searchInp clearfix">
						<!-- 科目类别 -->
						<p>
							<spring:message code="account_category" />
						</p>
						<select class="w-styleCategory" id="itemCategory" name="itemCategory" style="width: 150px">
							<option value=""><spring:message
									code="order_please_choose" /></option>
							<c:forEach items="${financeList}" var="item">
								<option value="${item.itemCode}-${item.itemValue}">${item.itemName}</option>
							</c:forEach>
						</select>
					</div>
					</div>
					<div class="searchRight clearfix" id="subItem">
						<!-- 检索 -->
						<button type="button" class="btn-js" onclick="searchListForm();">
							<spring:message code="commom_check" />
						</button>
 
						<!-- 重置 -->
						<button type="button" class="btn-js" onclick="clean();">
							<spring:message code="common_reset" />
						</button>
							
						<!-- 创建 -->
						<shiro:hasPermission name="finance:subject:edit">
							<button type="button" class="btn-cj"
								onclick="popup('816px','516px','${ctx}/finance/subject/form')">
							<spring:message code="common_create" />
							</button>
						</shiro:hasPermission>
					</div>
				</div>
				<div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 1293px;height: 714px; ">
						<table cellpadding="0" class="tableHead">
							<thead>
								<tr>
									<th><p class="table-No"><spring:message code="common_no" /></p></th>
									<th><p class="table-rq"><spring:message code="account_code" /></p></th>
									<th><p class="table-rq"><spring:message code="course_title" /></p></th>
									<th><p class="table-rq"><spring:message code="account_category" /></p></th>
									<th><p class="table-rq"><spring:message code="book_account" /></p></th>
									<th><p class="table-rq"><spring:message code="common_status" /></p></th>
									<th><p class="table-rq" style="width:160px;"><spring:message code="dict_remarks" /></p></th>
									<th><p class="table-rq"><spring:message code="cteate_people" /></p></th>
									<th><p class="table-rq"><spring:message code="cteate_date" /></p></th>	
								</tr>
							</thead>
						</table>
						<table cellpadding="0" class="tableBody"  style ="width:600px" >
							<tbody  id = "listHtml">
							</tbody>
						</table>
					</div>
				</div>
			</div>
			<div id = "paging" ></div>
		</form>
	</div>
</body>

</html>